package pl.animations 
{
	import flash.display.Bitmap;
	import starling.display.MovieClip;
	import starling.textures.Texture;
	import starling.textures.TextureAtlas;
	
	/**
	 * ...
	 * @author Bakudo
	 */
	public class Animations 
	{
		
		[Embed(source="assets/robot.png")]
		public static const Robot:Class;
		
		[Embed(source="assets/robot.xml" , mimeType="application/octet-stream")]
		public static const RobotXML:Class;
		
		public function Animations() 
		{
			
		}

		public static function getRobotAnimation(prefix:String,fps:uint = 12):MovieClip
		{
			var bitmap : Bitmap = new Animations['Robot']();
			var texture : Texture = Texture.fromBitmap(bitmap); 
			var xml : XML = XML(new RobotXML());
			var atlas : TextureAtlas = new TextureAtlas(texture, xml);
			return new MovieClip(atlas.getTextures(prefix), fps);
		}

		
		public static function getRobotAnimationDown():MovieClip
		{
			var bitmap : Bitmap = new Animations['Robot']();
			var texture : Texture = Texture.fromBitmap(bitmap); 
			var xml : XML = XML(new RobotXML());
			var atlas : TextureAtlas = new TextureAtlas(texture, xml);
			return new MovieClip(atlas.getTextures("move_down_"), 12);
		}
		
		public static function getRobotAnimationDownRight():MovieClip
		{
			var bitmap : Bitmap = new Animations['Robot']();
			var texture : Texture = Texture.fromBitmap(bitmap); 
			var xml : XML = XML(new RobotXML());
			var atlas : TextureAtlas = new TextureAtlas(texture, xml);
			return new MovieClip(atlas.getTextures("move_bottomRight_"), 12);
		}
		
		public static function getRobotAnimationRight():MovieClip
		{
			var bitmap : Bitmap = new Animations['Robot']();
			var texture : Texture = Texture.fromBitmap(bitmap); 
			var xml : XML = XML(new RobotXML());
			var atlas : TextureAtlas = new TextureAtlas(texture, xml);
			return new MovieClip(atlas.getTextures("move_right_"), 12);
		}
		
		
		
	}
}